package com.zjj.springstu.use.coreConcept.beanDefinitionReader;

import com.zjj.springstu.use.coreConcept.config.AppConfig;
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author zhanglei.zjj
 * @description 测试 XmlBeanDefinitionReader
 * @date 2023/4/15 10:49
 */
public class TestXmlBeanDefinitionReader {
    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        XmlBeanDefinitionReader definitionReader = new XmlBeanDefinitionReader(context);
        definitionReader.loadBeanDefinitions("spring.xml");
        System.out.println(context.getBean("user"));
    }
}
